﻿namespace Furesoft.Database.Client
{
    internal class SimpleClient
    {
        ClientInfo client;

        public event ConnectionReadBytes OnReadMessage;

        public void Start(string ip, int port)
        {
            var sock = Sockets.CreateTCPSocket(ip, port);
            client = new ClientInfo(sock, false);
            client.OnReadBytes += new ConnectionReadBytes(OnReadMessage);
            client.BeginReceive();
        }

        public void Send(string msg)
        {
            client.Send(msg);
        }
    }
}